]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Only animate dimming changes when necessary
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 22 Feb 2016 17:11:56 +0000 (18:11 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 22 Feb 2016 18:42:57 +0000 (19:42 +0100)
Now that we no longer skip dimming/undimming windows while showing
the overview, we can still save a bit of work by changing the dimming
without animation while the window is hidden.

https://bugzilla.gnome.org/show_bug.cgi?id=762475

js/ui/windowManager.js

index a36a71ffc21323d3ce27a208e75b65491ca4353d..bb54d836c299d11ded11bc48fda9c570e756ca9d 100644 (file)
@@ -1367,11 +1367,14 @@ const WindowManager = new Lang.Class({
         let dimmer = getWindowDimmer(actor);
         if (!dimmer)
             return;
-        Tweener.addTween(dimmer,
-                         { dimFactor: 1.0,
-                           time: DIM_TIME,
-                           transition: 'linear'
-                         });
+        if (this._shouldAnimate())
+            Tweener.addTween(dimmer,
+                             { dimFactor: 1.0,
+                               time: DIM_TIME,
+                               transition: 'linear'
+                             });
+        else
+            dimmer.dimFactor = 1.0;
     },
 
     _undimWindow: function(window) {
@@ -1381,10 +1384,13 @@ const WindowManager = new Lang.Class({
         let dimmer = getWindowDimmer(actor);
         if (!dimmer)
             return;
-        Tweener.addTween(dimmer,
-                         { dimFactor: 0.0,
-                           time: UNDIM_TIME,
-                           transition: 'linear' });
+        if (this._shouldAnimate())
+            Tweener.addTween(dimmer,
+                             { dimFactor: 0.0,
+                               time: UNDIM_TIME,
+                               transition: 'linear' });
+        else
+            dimmer.dimFactor = 0.0;
     },
 
     _mapWindow : function(shellwm, actor) {